<?php
/**
 * 账号
 * 
 * @author kaikaic
 * @date 2018-04-09
 *
 */

namespace service;


class   SendMsgService {

    public static function account() {
        return array('user'=>'mlyl', 'pwd'=>'mlyl8899','url'=>'http://121.201.45.167:8088/sms.aspx','user_id'=>54);
    }

    public static function curlPost($url,$data){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// post数据
        curl_setopt($ch, CURLOPT_POST, 1);
// post的变量
        curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
        curl_setopt($ch, CURLOPT_HEADER, 0);
//设置头部信息
        $headers = array('Content-Type:application/json; charset=utf-8','Content-Length: '.strlen($data));
        curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
//执行请求
        $output = curl_exec($ch);
        return WechatService::xmlToArray($output);
    }
}